# Author：kaijun

# 导入模块
import datetime
time = datetime.datetime.today().weekday()
# int() 函数用于将一个字符串或数字转换为整型
week_time = int(time)

# 模拟数据库数据
user_data = ["kaijun", "ykj", "kkz", "jjz"]
password_data = ["123"]
vip_user_date = ["kaijun"]


# 输入次数(只有五次登录的机会)
count = 5
while True:
    count -= 1

# 登陆中
    username = input("账号：")
    password = input("密码：")

    # 先判断账号是否是本网站用户
    if username in user_data or username in vip_user_date:
        # 再判断是否为VIP用户
        if username in vip_user_date:
            # 再判断密码是否正确
            if password in password_data:
                count = 10 # 代表有10次查询课表的机会
                print("Welcome to", username, "to use this website")
                print("You have ", count, " chances")
                if week_time == 0:
                    print("Today is a classless day.")
                    print("Have a good rest.")
                elif week_time == 1:
                    print("08:00-09:35 网球")
                    print("10:35-12:00 广告学概论")
                    print("14:30-15:55 新媒体时代的新闻评论")
                    print("16:10-17:35 大学英语")
                    print("18:45-20:55 创业基础")
                elif week_time == 2:
                    print("09:45-12:00 融合新闻学")
                    print("18:45-20:55 毛概理论")
                elif week_time == 3:
                    print("08:00-09:30 大学英语")
                    print("9:45-12:00 Python语言")
                    print("14:30-15-55 毛概实践")
                    print("16:10-17:35 证券投资方法与技巧")
                elif week_time == 4:
                    print("It's a classless day.")
                    print("Do what you love!")
                else:
                    print("It's the weekend! Let's relax!")
                count -= 1

                print("Do you want to continue querying the curriculum? "
                      "You have", count, "chances")
                # 增加用户选择和用户输入，为达到重复查询课表的目的
                choose_true = "Y"
                choose_false = "N"
                while True:
                    count -= 1
                    user_choose = input("Please enter Y or N：")
                    if user_choose == choose_true:
                        weekday = input("Please enter the week you want to query (a single Arabic numeral):")
                        if weekday == "1":
                            print("Today is a classless day.")
                            print("Have a good rest.")
                        elif weekday == "2":
                            print("08:00-09:35 网球")
                            print("10:35-12:00 广告学概论")
                            print("14:30-15:55 新媒体时代的新闻评论")
                            print("16:10-17:35 大学英语")
                            print("18:45-20:55 创业基础")
                        elif weekday == "3":
                            print("09:45-12:00 融合新闻学")
                            print("18:45-20:55 毛概理论")
                        elif weekday == "4":
                            print("08:00-09:30 大学英语")
                            print("9:45-12:00 Python语言")
                            print("14:30-15-55 毛概实践")
                            print("16:10-17:35 证券投资方法与技巧")
                        elif weekday == "5":
                            print("It's a classless day.")
                            print("Do what you love!")
                        else:
                            print("You check your schedule on weekends? Are you kidding me?")
                        print("You have ", count, " chances")
                    elif user_choose == choose_false:
                        break
                    else:
                        print("If you don't enter these two letters, you'll lose a chance to query, "
                              "hoping you can learn your lesson")
                    if count == 0:
                        print("You have used today's query function, come back tomorrow!")
                        break
            else:
                if count == 0:
                    print("You have no chance to enter your account number and password.")
                    break
                else:
                    print("The account or password you entered is incorrect, please enter it again.")
                    print("You have ", count, " chances")
                    continue

                    #当不是VIP用户的时候
        elif username in user_data:
            if password in password_data:
                count = 5
                print("Welcome to", username, "to use this website")
                print("You have ", count, " chances")
                if week_time == 0:
                    print("Today is a classless day.")
                    print("Have a good rest.")
                elif week_time == 1:
                    print("08:00-09:35 网球")
                    print("10:35-12:00 广告学概论")
                    print("14:30-15:55 新媒体时代的新闻评论")
                    print("16:10-17:35 大学英语")
                    print("18:45-20:55 创业基础")
                elif week_time == 2:
                    print("09:45-12:00 融合新闻学")
                    print("18:45-20:55 毛概理论")
                elif week_time == 3:
                    print("08:00-09:30 大学英语")
                    print("9:45-12:00 Python语言")
                    print("14:30-15-55 毛概实践")
                    print("16:10-17:35 证券投资方法与技巧")
                elif week_time == 4:
                    print("It's a classless day.")
                    print("Do what you love!")
                else:
                    print("It's the weekend! Let's relax!")
                count -= 1

                print("Do you want to continue querying the curriculum? "
                      "You have", count, "chances")
                choose_true = "Y"
                choose_false = "N"
                while True:
                    count -= 1
                    user_choose = input("Please enter Y or N：")
                    if user_choose == choose_true:
                        weekday = input("Please enter the week you want to query (a single Arabic numeral):")
                        if weekday == "1":
                            print("Today is a classless day.")
                            print("Have a good rest.")
                        elif weekday == "2":
                            print("08:00-09:35 网球")
                            print("10:35-12:00 广告学概论")
                            print("14:30-15:55 新媒体时代的新闻评论")
                            print("16:10-17:35 大学英语")
                            print("18:45-20:55 创业基础")
                        elif weekday == "3":
                            print("09:45-12:00 融合新闻学")
                            print("18:45-20:55 毛概理论")
                        elif weekday == "4":
                            print("08:00-09:30 大学英语")
                            print("9:45-12:00 Python语言")
                            print("14:30-15-55 毛概实践")
                            print("16:10-17:35 证券投资方法与技巧")
                        elif weekday == "5":
                            print("It's a classless day.")
                            print("Do what you love!")
                        else:
                            print("You check your schedule on weekends? Are you kidding me?")
                        print("You have ", count, " chances")
                    elif user_choose == choose_false:
                        break
                    else:
                        print("If you don't enter these two letters, you'll lose a chance to query, "
                              "hoping you can learn your lesson")
                    if count == 0:
                        print("You have used today's query function, come back tomorrow!")
                        break
            else:
                if count == 0:
                    print("You have no chance to enter your account number and password.")
                    break
                else:
                    print("The account or password you entered is incorrect, please enter it again.")
                    print("You have ", count, " chances")
                    continue
        else:
            if count == 0:
                print("You have no chance to enter your account number and password.")
                break
            else:
                print("The account or password you entered is incorrect, please enter it again.")
                print("You have ", count, " chances")
                continue
    else:
        if count == 0:
            print("You have no chance to enter your account number and password.")
            break
        else:
            print("The account or password you entered is incorrect, please enter it again.")
            print("You have ", count, " chances")
            continue
